/**

This file is part of MaCI/GIMnet.

MaCI/GIMnet is free software: you can redistribute it and/or modify it 
under the terms of the GNU Lesser General Public License as published 
by the Free Software Foundation, either version 3 of the License, or 
(at your option) any later version.

MaCI/GIMnet is distributed in the hope that it will be useful, but WITHOUT 
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public 
License for more details.

You should have received a copy of the GNU Lesser General Public 
License along with GIMnet. (See COPYING.LESSER) If not, see 
<http://www.gnu.org/licenses/>.

**/
// -*- coding:iso-8859-15 mode: c++ -*-
/** 
 * \file
 * \brief MaCI_SpeedCtrl Logger header.
 * \author Matthieu Myrsky <matthieu.myrsky@tkk.fi>
 *
 * $Id: RangingLogger.hpp,v 1.5 2009-06-12 12:49:23 morsko Exp $
 *
 */
#ifndef _RANGINGLOGGER_HPP_
#define _RANGINGLOGGER_HPP_
#include <string>
#include <vector>
#include "Logger.hpp"
#include "owndebug.h"
#include "ownutils.h"
#include "RangingClient.hpp"
#include "RangingFileWriter.hpp"

class RangingLogger: private gim::CSync, 
                     private gim::CThread,
                     public Logger

{
public:

  /**
   * Constructor
   * 
   * @param 
   */
  RangingLogger(MaCI::Ranging::CRangingClient *aClient,
                std::string aMaCISLName);
   

  /**
   * Destructor
   */
  virtual ~RangingLogger();

  /**
   * Starts logging selected type(s)
   *
   * @return      True if logging started, else false
   */
  bool StartLogging(void);

  /**
   * Stops logging selected type(s)
   *
   * @return      True if logging started, else false
   */
  bool StopLogging(void);

  std::string GetName(void);

  TMenu *GetMenu(void);
  
  bool GetAdditionalInformation(std::string &aInformation);

  bool SetMenuItem(std::string aItem, bool aValue);
private:
  MaCI::Ranging::CRangingClient *iRClient;
  bool iRunning;
  bool iRunningThreadStopped;
  CRangingFileWriter iFileWriter;
  std::string iMaCISLName;
  std::string iAdditionalInformation;
  TMenu iMenu;
  int ThreadFunction(const int aThreadNumber);
  
  RangingLogger(const RangingLogger&):
    CSync(1, 1),               
    CThread(1),                
    Logger(),
    iRClient(NULL),
    iRunning(false),
    iRunningThreadStopped(true),
    iFileWriter(),
    iMaCISLName(""),
    iAdditionalInformation(""),
    iMenu()
    
  {}

  RangingLogger &operator=(const RangingLogger&){return *this;}
};
#endif

